home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2007 December / PCWKCD1207B.iso / Blogowanie poza sfera / Flock 0.9.1.3 stable / flock-0.9.1.3.en-US.win32.exe / flock / chrome / browser.jar / content / browser / web-panels.js < prev    next >
Text File  |  2006-02-28  |  3KB  |  74 lines

  1. //@line 38 "/cygdrive/K/tinderbuild/src/flock/mozilla/browser/base/content/web-panels.js"
  2.  
  3. var panelProgressListener = {
  4.     onProgressChange : function (aWebProgress, aRequest,
  5.                                     aCurSelfProgress, aMaxSelfProgress,
  6.                                     aCurTotalProgress, aMaxTotalProgress) {
  7.     },
  8.     
  9.     onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus)
  10.     {
  11.         if (!aRequest)
  12.           return;
  13.  
  14.         //ignore local/resource:/chrome: files
  15.         if (aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO)
  16.            return;
  17.  
  18.         const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
  19.         const nsIChannel = Components.interfaces.nsIChannel;
  20.         if (aStateFlags & nsIWebProgressListener.STATE_START && 
  21.             aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
  22.             window.parent.document.getElementById('sidebar-throbber').setAttribute("loading", "true");
  23.         }
  24.         else if (aStateFlags & nsIWebProgressListener.STATE_STOP &&
  25.                 aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
  26.             window.parent.document.getElementById('sidebar-throbber').removeAttribute("loading");
  27.         }
  28.     }
  29.     ,
  30.  
  31.     onLocationChange : function(aWebProgress, aRequest, aLocation) {
  32.     },
  33.  
  34.     onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage) {
  35.     },
  36.  
  37.     onSecurityChange : function(aWebProgress, aRequest, aState) { 
  38.     },
  39.  
  40.     QueryInterface : function(aIID)
  41.     {
  42.         if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
  43.             aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
  44.             aIID.equals(Components.interfaces.nsISupports))
  45.         return this;
  46.         throw Components.results.NS_NOINTERFACE;
  47.     }
  48. };
  49.  
  50. var gLoadFired = false;
  51. function loadWebPanel(aURI) {
  52.     var panelBrowser = document.getElementById('web-panels-browser');
  53.     if (gLoadFired)
  54.         panelBrowser.webNavigation.loadURI(aURI, nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
  55.     panelBrowser.setAttribute("cachedurl", aURI);
  56. }
  57.  
  58. function load()
  59. {
  60.   var panelBrowser = document.getElementById('web-panels-browser');
  61.   panelBrowser.webProgress.addProgressListener(panelProgressListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
  62.   if (panelBrowser.getAttribute("cachedurl"))
  63.     panelBrowser.webNavigation.loadURI(panelBrowser.getAttribute("cachedurl"), nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
  64.   gNavigatorBundle = document.getElementById("bundle_browser");
  65.     
  66.   gLoadFired = true;
  67. }
  68.  
  69. function unload()
  70. {
  71.   var panelBrowser = document.getElementById('web-panels-browser');
  72.   panelBrowser.webProgress.removeProgressListener(panelProgressListener);
  73. }
  74.